package net.melon.sso.service;

import java.util.Collection;
import java.util.List;

import net.esj.basic.exception.MelonException;
import net.esj.basic.pojo.op.AuthFunction;
import net.melon.sso.pojo.Config;
import net.melon.sso.pojo.Member;
import net.melon.sso.pojo.MemberExtra;
import net.melon.sso.pojo.MemberType;
import net.melon.sso.pojo.WebSite;


public interface SSOManage {
	
	void deleteMemberType(String id);

	List<MemberType> listMemberType();
	
	/**
	 * 获得配置的额外属性
	 * 如为自动获取则范围emptylist
	 * @return
	 */
	List<Config> getExtras();
	
	boolean isAutoExtra();
	
	Member getMember(String id);
	
	Member getMember(String id,boolean withExtra);
	
	Member saveMember(Member member) throws MelonException;
	
	Member updateMember(Member member) throws MelonException;
	
	/**
	 * 新增或修改一项额外属性
	 * @param memberId
	 * @param name
	 * @param value
	 * @param webSite
	 */
	void addExtra(String memberId,String name,String value,WebSite webSite);
	
	List<MemberExtra> listMemberExtra(String memberId);

	boolean checkDeleteConfig(Config config);
	
	List<MemberExtra> getMemberExtraListByConfigKey(Config config);

	MemberType getMemberType(String id);

	Collection<AuthFunction> authFunctions(Member member);
	
	MemberType defaultRegisityMemberType();

	void editPass(Member member, String pwd);

}
